package com.flashextended.apps.logomaker.view.windows.properties.content
{
	import com.flashextended.apps.logomaker.beans.workareaobjects.SymbolOnStage;
	import com.flashextended.apps.logomaker.singleton.AppControl;
	import com.flashextended.apps.logomaker.singleton.AppLocales;
	
	import mx.controls.ColorPicker;
	import mx.events.ColorPickerEvent;
	
	public class SymbolPropertiesContent extends GenericPropertiesContent
	{
		private var cp:ColorPicker;
		protected var currentSelectedObject:SymbolOnStage;
		
		public function SymbolPropertiesContent()
		{
			super();
			addColorPicker();
		}
		
		private function addColorPicker():void
		{
			currentSelectedObject = SymbolOnStage(AppControl.getInstance().workarea.getReferenceObject());
			cp = new ColorPicker();
			this.getCommonMenuContainer().addChild(buildMenuLabels(cp, AppLocales.getInstance().data.locales["symbolColor"]));
			cp.selectedColor = currentSelectedObject.symbolColor;
			cp.addEventListener(ColorPickerEvent.CHANGE, cpHandler);
		}
		
		private function cpHandler(e:ColorPickerEvent):void
		{
			currentSelectedObject.symbolColor = cp.selectedColor;
		}
		
	}
}